package com.kgc.service.impl;

import com.kgc.dao.*;
import com.kgc.pojo.*;
import com.kgc.service.GetMangerInfo_wzlService;
import com.kgc.service.GetTicketDetailInfo_wzlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 获得票类信息
 * @author  王臻利
 */
@Service
public class GetTicketDetailInfo_wzlServiceImpl implements GetTicketDetailInfo_wzlService {
    @Autowired
    private TicketInfoMapper ticketInfoMapper;
    @Autowired
    private TicketCityMapper ticketCityMapper;
    @Autowired
    private TicketInfoMapper_wzl ticketInfoMapper_wzl;
    @Autowired
    private TicketTypeMapper ticketTypeMapper;
    /*获取商品信息表*/
    public List<TicketInfo> getTicketDetailInfo_wzl(){
        return ticketInfoMapper_wzl.getTicketDetailInfo_wzl();
    }

    /*增加商品信息*/
    public int addTicketInfo_wzl(TicketInfo ticketInfo){
        return ticketInfoMapper.insertSelective(ticketInfo);
    }
    /*删除商品信息*/
    public int delTicketInfo_wzl(int id){
        return ticketInfoMapper.deleteByPrimaryKey(id);
    }
    /*查询城市*/
    public List<TicketCity> selectcity_wzl(){
        TicketCityExample ticketCityExample =new TicketCityExample();
        return ticketCityMapper.selectByExample(ticketCityExample);
    }
    /*支付页面数据查询*/
    public TicketInfo checkTicketInfo(int id){
        return ticketInfoMapper_wzl.checkTicketInfo(id);
    }
    /*票类表的查询*/
    public TicketType selectTicketTypeByPrimaryKey(int id){
        return ticketTypeMapper.selectByPrimaryKey(id);
    }
    /*票数更新*/
    public int updateTicketCounts(int id , int num){
        return ticketInfoMapper_wzl.updateUserType(id,num);
    }
}
